package com.fengye.algorithms.leecode.dp;

/**
 * @Author fengye
 * @Date 2023/5/1 7:38
 **/
public class JumpGame55 {
    public static void main(String[] args) {
        new JumpGame55().canJump(new int[]{3,2,1,0,4});
    }
    public boolean canJump(int[] nums) {
        int j=0;
        for(int i=0;i<nums.length;i++) {
            if(i>j) {
                return false;
            }

            j = Math.max(j, i+nums[i]);
        }
        return true;
    }
}
